package com.bt.lms.ui.page.sys.style.action.btn;

import com.bt.lms.ui.page.sys.style.BtnStyle;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;

/**
 * 添加按钮的交互事件
 * 鼠标移入
 */
public class AddBtnMouseAction implements EventHandler<MouseEvent> {

    /**
     * 添加按钮
     */
    private final Button button;

    /**
     * 构建事件
     *
     * @param button 添加按钮
     */
    public AddBtnMouseAction(Button button) {
        this.button = button;
    }

    /**
     * 事件执行
     *
     * @param event the event which occurred
     */
    @Override
    public void handle(MouseEvent event) {

        Color color = Color.rgb(112,213,247);
        Color toColor = Color.rgb(27,157,196);

        BtnStyle.addBtnBackground(button, color, toColor);

    }
}
